home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / kriegspi / externs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-30  |  2.6 KB  |  87 lines

  1. /*
  2.  * $Header: externs.h,v 1.5 87/05/19 18:48:30 schoch Exp $
  3.  */
  4.  
  5. #include "constants.h"
  6. #include <stdio.h>
  7.  
  8. #ifdef XKS
  9. #include <X/Xlib.h>
  10. #define NULL 0
  11. #define TOPSPACE    (64+18)
  12. #define FALSE        0
  13. #define TRUE        1
  14. typedef unsigned char bool;
  15. #else
  16. #include <curses.h>
  17. #endif XKS
  18.  
  19. #include <errno.h>
  20. #include <sys/types.h>
  21. /* on machines without alloca () */
  22. /* #define alloca malloc         */
  23.  
  24. struct IN
  25. {
  26.     int i;
  27.     struct IN *n;
  28. };
  29. typedef struct IN *LIST;
  30.  
  31. struct MOVE
  32. {
  33.     int from;
  34.     int to;
  35.     struct MOVE *n;
  36. };
  37. typedef struct MOVE *MOVELIST;
  38.  
  39. extern    u_char    occupant [100];        /* what piece occupies square    */
  40. extern    u_char    whose [100];        /* which color occupies square    */
  41. extern    LIST    dirlist [7];        /* directions a piece moves    */
  42. extern        pawndir    [2];        /* direction pawns of move    */
  43. extern    LIST    piecelocs [2];        /* locations of pieces        */
  44. extern    int    kingloc [2];        /* location of king        */
  45. extern    MOVELIST movelist;        /* record of game        */
  46. extern    u_char    ourcolor;
  47. extern    u_char    theircolor;
  48. extern    char    *colorname [];
  49. extern    int    lastmovefrom;
  50. extern    int    lastmoveto;
  51. extern    u_char    virgin [100];         /* pieces not moved or captured    */
  52. extern    bool    drawok [2];        /* side has agreed to draw    */
  53. extern    bool    resign;            /* somebody resigned        */
  54. extern    bool    dead;            /* somebody died        */
  55. extern    bool    reverse;        /* Show board in reverse    */
  56. extern    u_char    color;            /* Who's turn it is        */
  57. extern    u_char    state;            /* What state we're in        */
  58. extern    u_char    option [NOPTIONS];    /* options players must agree on*/
  59. extern    bool    iamserver;        /* am I the server player?    */
  60. extern    FILE    *inp, *out;        /* socket for opponent        */
  61. extern    int    errno;            /* system error numbers        */
  62.  
  63. #ifdef XKS
  64. Window    window;
  65. Window    iconwindow;
  66. Font    font;
  67. int    move;                /* piece being moved by mouse    */
  68. Pixmap    pieces_masks[8];
  69. Pixmap    pieces_icons[8];
  70. extern    u_char    ghost[100];        /* opponent's "ghost" pieces    */
  71. extern    u_char    captured[32];        /* pieces captured        */
  72. #else
  73. extern    char    symbol [7];        /* symbols for printing pieces    */
  74. extern    WINDOW    *blanksq [89];        /* blank chessboard squares    */
  75. extern    WINDOW    *square [89];        /* contents of chessboard    */
  76. extern    WINDOW    *win [23];        /* message window areas        */
  77. extern    WINDOW    *backupwin [23];    /* for switching screens    */
  78. extern    WINDOW    *backupscreen;        /* used for redrawing vt220    */
  79. extern    WINDOW    *blankscreen;        /* used for redrawing vt220    */
  80. extern    char    sqcolor [2];        /* character used for square    */
  81. extern    bool    vtterm;            /* is this a vt220?        */
  82. extern    bool    dumbterm;        /* are we dumb?            */
  83. extern    bool    reversescr;        /* can terminal inverse video?    */
  84. extern    int    sqheight;        /* height of a square        */
  85. extern    int    sqwidth;        /* width of a square        */
  86. #endif
  87.